<HTML><HEAD><TITLE>delay(?Variables, +Goal)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>delay(?Variables, +Goal)</H1>
Delay the Goal on all variables in the term Variables.


<DL>
<DT><EM>Variables</EM></DT>
<DD>Any Prolog term.
</DD>
<DT><EM>Goal</EM></DT>
<DD>A callable term.
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   The specified goal Goal is made a suspended goal such that it will be
   woken whenever any of the variables in the term Variables is bound (even
   to another variable).  This predicate is obsolete, a more precise
   control over suspending and waking is obtained using make_suspension/3
   and insert_suspension/3,4 and with the suspend.pl library.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>delay(?, +) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Goal is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Goal is not a callable term.
<DT><EM>(60) referring to an undefined procedure </EM>
<DD>Goal does not refer to an existing procedure.
</DL>
<H2>Examples</H2>
<PRE>
[eclipse 1]: delay(X, writeln(hello)).

X = X

Delayed goals:
        writeln(hello)
yes.
[eclipse 2]: delay(X, writeln(hello)),
        writeln(one),
        X=1,            % causes waking
        writeln(two).
one
hello
two

X = 1
yes.
[eclipse 3]: delay([X,Y], writeln(X)), X=Y.
X

X = X
Y = X
yes.


</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/suspensions/suspend-3.html">suspend / 3</A>, <A HREF="../../kernel/suspensions/make_suspension-3.html">make_suspension / 3</A>, <A HREF="../../kernel/suspensions/insert_suspension-3.html">insert_suspension / 3</A>
</BODY></HTML>
